<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>菜单管理</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="../../assets/module/admin.css?v=314"/>
    <link rel="stylesheet" href="../../assets/css/publicStyle.css">
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-fluid .layui-card{
            height:calc(100vh - 30px);
            overflow: auto;
        }
    </style>
</head>
<body>

<!-- 页面加载loading -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>

<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <button id="btnAddAuth" class="layui-btn icon-btn layui-btn-sm"><i class="layui-icon">&#xe654;</i>新增</button>
                        <button id="btnRefreshAuth" class="layui-btn icon-btn layui-btn-sm"><i class="layui-icon">&#xe669;</i>刷新</button>
                    </div>
                </div>
            </div>

            <table class="layui-table" id="tableAuth" lay-filter="tableAuth"></table>
        </div>
    </div>
</div>

<!-- 表格操作列 -->
<script type="text/html" id="tableBarAuth">
    {{#  if(d.type ==0||d.type ==2 ){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="add">新增</a>
    {{#  } }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<style>
    #AddResourceForm input{
        width: 100% !important;
    }
    #editResourceForm input{
        width: 100% !important;
    }
</style>
<!-- 新增菜单弹窗 -->
<script type="text/html" id="AddResourceModel">
    <form id="AddResourceForm" lay-filter="AddResourceForm" class="layui-form model-form">
        <input name="authorityId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">资源名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入资源名称" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源类型</label>
            <div class="layui-input-block">
                <input name="type" type="radio" value="2" title="模块" checked/>
                <input name="type" type="radio" value="0" title="菜单"/>
                <input name="type" type="radio" value="1" title="按钮"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源链接</label>
            <div class="layui-input-block">
                <input name="path" placeholder="请输入资源链接" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源权限</label>
            <div class="layui-input-block">
                <input name="permission" placeholder="请输入资源权限" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">请求url</label>
            <div class="layui-input-block">
                <input name="url" placeholder="请输入请求url" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">请求方法</label>
            <div class="layui-input-block">
                <select name="method" placeholder="请选择请求方法">
                    <option value="GET">GET</option>
                    <option value="PUT">PUT</option>
                    <option value="PATCH">PATCH</option>
                    <option value="DELETE">DELETE</option>
                    <option value="POST">POST</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">组件路径</label>
            <div class="layui-input-block">
                <input name="component" placeholder="请输入组件路径" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源图标</label>
            <div class="layui-input-block">
                <input name="icon" placeholder="请输入资源图标" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序权重</label>
            <div class="layui-input-block">
                <input name="sort" placeholder="请输入排序权重" type="text" class="layui-input" min="0" max="1000"
                       lay-verType="tips" lay-verify="number" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">打开方式</label>
            <div class="layui-input-block">
                <select name="openType" placeholder="请选择打开方式">
                    <option value="">请选择打开方式</option>
                    <option value="0">当前页面</option>
                    <option value="1">打开新页面</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitAuth" lay-submit>保存</button>
        </div>
    </form>
</script>

<!-- 编辑菜单弹窗 -->
<script type="text/html" id="editResourceModel">
    <form id="editResourceForm" lay-filter="editResourceForm" class="layui-form model-form">
        <input name="authorityId" type="hidden"/>
        <div class="layui-form-item">
            <label class="layui-form-label">资源名称</label>
            <div class="layui-input-block">
                <input name="name" placeholder="请输入资源名称" type="text" class="layui-input" maxlength="50"
                       lay-verType="tips" lay-verify="required" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源类型</label>
            <div class="layui-input-block">
                <input name="type" type="radio" value="2" title="模块" checked/>
                <input name="type" type="radio" value="0" title="菜单" />
                <input name="type" type="radio" value="1" title="按钮"/>

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源链接</label>
            <div class="layui-input-block">
                <input name="path" placeholder="请输入资源链接" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源权限</label>
            <div class="layui-input-block">
                <input name="permission" placeholder="请输入资源权限" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">请求url</label>
            <div class="layui-input-block">
                <input name="url" placeholder="请输入请求url" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">请求方法</label>
            <div class="layui-input-block">
                <select name="method" placeholder="请选择请求方法">
                    <option value="GET">GET</option>
                    <option value="PUT">PUT</option>
                    <option value="PATCH">PATCH</option>
                    <option value="DELETE">DELETE</option>
                    <option value="POST">POST</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">组件路径</label>
            <div class="layui-input-block">
                <input name="component" placeholder="请输入组件路径" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">资源图标</label>
            <div class="layui-input-block">
                <input name="icon" placeholder="请输入资源图标" type="text" class="layui-input"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序权重</label>
            <div class="layui-input-block">
                <input name="sort" placeholder="请输入排序权重" type="text" class="layui-input" min="0" max="1000"
                       lay-verType="tips" lay-verify="number" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">打开方式</label>
            <div class="layui-input-block">
                <select name="openType" placeholder="请选择打开方式">
                    <option value="0">当前页面</option>
                    <option value="1">打开新页面</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitAuth" lay-submit>保存</button>
        </div>
    </form>
</script>

<!-- js部分 -->
<script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="../../assets/js/common.js?v=314"></script>

<script src="../../assets/libs/template-web.js"></script>
<script src="../../assets/libs/axios.min.js"></script>
<script src="../../assets/js/config.js"></script>
<script src="../../assets/js/authority.js"></script>

<script src="../../assets/js/system/authorities.js"></script>

</body>
</html>